package com.zqxq.lottery.cms.feign;

import com.baomidou.mybatisplus.plugins.Page;
import com.zqxq.common.bo.BaseBO;
import com.zqxq.common.constant.Result;
import com.zqxq.lottery.entity.bo.order.UserOrderBO;
import com.zqxq.lottery.entity.bo.product.ProductBO;
import com.zqxq.lottery.entity.bo.product.ProductSearchBO;
import com.zqxq.lottery.entity.bo.sys.*;
import com.zqxq.lottery.entity.bo.user.UserCashBO;
import com.zqxq.lottery.entity.bo.user.UserCashSearchBO;
import com.zqxq.lottery.entity.bo.user.UserInfoCMSBO;
import com.zqxq.lottery.entity.bo.user.UserPrizeBO;
import com.zqxq.lottery.entity.vo.jczq.JczqMatchLiveVO;
import com.zqxq.lottery.entity.vo.order.UserOrderVO;
import com.zqxq.lottery.entity.vo.product.ProductVO;
import com.zqxq.lottery.entity.vo.sys.*;
import com.zqxq.lottery.entity.vo.user.*;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.cloud.netflix.feign.FeignClientsConfiguration;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.File;
import java.util.List;
import java.util.Map;

@FeignClient(value = "lottery-server", configuration = FeignClientsConfiguration.class)
public interface LotteryServerFeignClient {
    //系统
    /**---------------------------竞猜种类-------------------------**/
    @RequestMapping(value="/sys/lotterykind/page", method = RequestMethod.POST)
    Result queryLotteryKindPage(@RequestBody LotteryKindBO search);

    @RequestMapping(value="/sys/lotterykind/list", method = RequestMethod.POST)
    Result queryLotteryKindList(@RequestBody LotteryKindBO search);

    @RequestMapping(value="/sys/lotterykind/add", method = RequestMethod.POST)
    Result addLotteryKind(@RequestBody LotteryKindVO vo);

    @RequestMapping(value="/sys/lotterykind/get", method = RequestMethod.POST)
    Result getLotteryKind(@RequestParam("id") Long id);

    @RequestMapping(value="/sys/lotterykind/updateStatus", method = RequestMethod.POST)
    Result updateLotteryKindStatus(@RequestParam("id") Long id, @RequestParam("status") int status);

    @RequestMapping(value="/sys/lotterykind/updateSort", method = RequestMethod.POST)
    Result updateLotteryKindSort(@RequestParam("id") Long id, @RequestParam("sort") int sort);

    /**---------------------------竞猜种类-------------------------**/
    @RequestMapping(value="/sys/lotteryhnum/page", method = RequestMethod.POST)
    Result queryLotteryHnumPage(@RequestBody LotteryHnumBO search);

    @RequestMapping(value="/sys/lotteryhnum/newNext", method = RequestMethod.POST)
    Result newNextLotteryHnum(@RequestParam("lotteryId") Long lotteryId);

    @RequestMapping(value="/sys/lotteryhnum/syncFromJisu", method = RequestMethod.POST)
    Result syncLotteryHnumFromJisu(@RequestParam("lotteryId") Long lotteryId,@RequestParam(value = "period",required = false) String period);

    @RequestMapping(value="/sys/lotteryhnum/closeLottery", method = RequestMethod.POST)
    Result closeLottery(@RequestParam("lotteryId") Long lotteryId);

    //用户
    /**---------------------------中奖名单-------------------------**/
    @RequestMapping(value="/user/userprize/page", method = RequestMethod.POST)
    Result queryUserPrizePage(@RequestBody UserPrizeBO search);
    /**---------------------------用户提现、充值记录-------------------------**/
    @RequestMapping(value="/user/usercash/page", method = RequestMethod.POST)
    Result queryUserCashPage(@RequestBody UserCashBO search);
    @RequestMapping(value="/user/usercash/query", method = RequestMethod.POST)
    Result<List<UserCashVO>> queryUserCash(@RequestBody UserCashSearchBO search);
    @RequestMapping(value="/user/usercash/pageCZ", method = RequestMethod.POST)
    Result queryUserCashPageCZ(@RequestBody UserCashBO search);
    @RequestMapping(value="/user/usercash/pageTX", method = RequestMethod.POST)
    Result queryUserCashPageTX(@RequestBody UserCashBO search);
    @RequestMapping(value="/user/usercash/getTX", method = RequestMethod.POST)
    Result getUserCashTX(@RequestParam("id") Long id);
    @RequestMapping(value="/userFunds/auditDrawCash", method = RequestMethod.POST)
    Result auditDrawCash(@RequestParam("orderId") Long orderId, @RequestParam("status") Integer status, @RequestParam("auditUser") String auditUser);
    //订单
    /**---------------------------用户订单-------------------------**/
    @RequestMapping(value="/order/userorder/page", method = RequestMethod.POST)
    Result queryUserOrderPage(@RequestBody UserOrderBO search);

    @RequestMapping(value="/order/userorder/get", method = RequestMethod.POST)
    Result getUserOrder(@RequestParam("id") Long id);

    @RequestMapping(value="/order/userorder/save", method = RequestMethod.POST)
    Result saveUserOrder(@RequestBody UserOrderVO vo);

    @RequestMapping(value="/order/orderticket/save", method = RequestMethod.POST)
    Result saveOrderTickets(@RequestParam("orderId") String orderId, @RequestParam("ticketUrls") String ticketUrls);

    @RequestMapping(value="/order/lottery/calc", method = RequestMethod.POST)
    Result orderLotteryCalc(@RequestParam("lotteryId") Long lotteryId);

    @RequestMapping(value="/order/userorder/buyTicket", method = RequestMethod.POST)
    Result buyTicket(@RequestParam("orderId") Long orderId);

    /**
     * banner
     * @param baseBO
     * @return
     */
    @RequestMapping(value="/sysBanner/queryPageList", method = RequestMethod.POST)
    Result<Page<SysBannerVO>> queryBannerPageList(@RequestBody BaseBO baseBO);
    @RequestMapping(value="/sysBanner/save", method = RequestMethod.POST)
    Result saveBanner(@RequestBody SysBannerVO vo);
    @RequestMapping(value="/sysBanner/saveClickNum", method = RequestMethod.POST)
    Result saveBannerClickNum(@RequestParam("id") Long id);
    @RequestMapping(value = "/sysBanner/close",method = RequestMethod.POST)
    Result closeBanner(@RequestParam("id") Long id);

    /**
     * 平台发现
     * @param cmsbo
     * @return
     */
    @RequestMapping(value="/sysDiscovery/queryPageList", method = RequestMethod.POST)
    Result<Page<SysDiscoveryVO>> queryDiscoveryPageList(@RequestBody SysDiscoveryCMSBO cmsbo);
    @RequestMapping(value="/sysDiscovery/save", method = RequestMethod.POST)
    Result saveDiscovery(@RequestBody SysDiscoveryVO vo);
    @RequestMapping(value = "/sysDiscovery/close",method = RequestMethod.POST)
    Result closeDiscovery(@RequestParam("id") Long id);

    /**
     * 消息
     * @param baseBO
     * @return
     */
    @RequestMapping(value="/sysMsg/queryPageList", method = RequestMethod.POST)
    Result<Page<SysMsgVO>> queryMsgPageList(@RequestBody SysMsgCMSBO baseBO);
    @RequestMapping(value="/sysMsg/save", method = RequestMethod.POST)
    Result saveMsg(@RequestBody SysMsgVO vo);
    @RequestMapping(value="/sysMsg/delete", method = RequestMethod.POST)
    Result deleteMsg(@RequestParam("id")Long id);
    @RequestMapping(value="/sysMsg/update", method = RequestMethod.POST)
    Result updateMsg();

    /**
     *  咨询
     * @param baseBO
     * @return
     */
    @RequestMapping(value="/sysNews/queryPageList", method = RequestMethod.POST)
    Result<Page<SysNewsVO>> queryNewsPageList(@RequestBody SysNewsCMSBO baseBO);
    @RequestMapping(value="/sysNews/get", method = RequestMethod.POST)
    Result<SysNewsVO> getNews(@RequestParam("id")Long id);
    @RequestMapping(value="/sysNews/save", method = RequestMethod.POST)
    Result saveNews(@RequestBody SysNewsVO vo);
    @RequestMapping(value = "/sysNews/close",method = RequestMethod.POST)
    Result closeNews(@RequestParam("id") Long id);

    /**
     * 用户
     * @param bo
     * @return
     */
    @RequestMapping(value="/userInfo/queryPageList", method = RequestMethod.POST)
    Result<Page<UserInfoCMSVO>> queryUserPageList(@RequestBody UserInfoCMSBO bo);
    @RequestMapping(value="/userInfo/getCMSVO", method = RequestMethod.POST)
    Result<UserInfoCMSVO> getUserCMSVO(@RequestParam("userId") Long userId,@RequestParam("pageNo") Integer pageNo,@RequestParam("pageSize") Integer pageSize);

    /**---------------------------数据统计-------------------------**/
    /**
     * 数据统计
     * @return
     * @param startTime
     * @param endTime
     */
    @RequestMapping(value = "/data/dayStatistics",method = RequestMethod.POST)
    Result dayStatistics(@RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime);

    /**
    * @Author 苦智
    * @Description 渠道统计
    * @Date 10:38 2018/4/25
    * @Param [paramMap]
    * @return com.zqxq.common.constant.Result
    **/
    @RequestMapping(value = "/data/getChannelCount",method = RequestMethod.POST)
    Result getChannelCount(@RequestBody Map<String, Object> paramMap);

    @RequestMapping(value = "/data/getChannelCountList",method = RequestMethod.POST)
    Result getChannelCountList(@RequestBody Map<String, Object> paramMap);

    //销售漏斗
    @RequestMapping(value = "/data/saleFunnelCount",method = RequestMethod.POST)
    Result saleFunnel(@RequestParam("startTime") String startTime,@RequestParam("endTime") String endTime,@RequestParam("timeType") Integer timeType,
                      @RequestParam("client") Integer client,@RequestParam("pageNo") Integer pageNo,@RequestParam("pageSize") Integer pageSize);

    //用户活跃度分析
    @RequestMapping(value = "/data/userActivity",method = RequestMethod.POST)
    Result userActivityAnalysis(@RequestParam("startTime") String startTime,@RequestParam("endTime")  String endTime,
                                @RequestParam("source")  Integer source,@RequestParam("pageNo") Integer pageNo,
                                @RequestParam("pageSize") Integer pageSize,@RequestParam("timeType") Integer timeType);

    //产品表现统计
    @RequestMapping(value = "/data/productPerformance",method = RequestMethod.POST)
    Result productPerformance(@RequestParam("startTime") String startTime,@RequestParam("endTime") String endTime, @RequestParam("gameType") Integer gameType);

    /**
    * @Author 苦智
    * @Description 获取
    * @Date 10:20 2018/4/26
    * @Param []
    * @return com.zqxq.common.constant.Result
    **/
    @RequestMapping(value = "/data/getAllChannel",method = RequestMethod.POST)
    Result getAllChannel();

    @RequestMapping(value = "/data/getMerchantDataCount",method = RequestMethod.POST)
    Result getMerchantUserOrder(@RequestBody Map<String, Object> paramMap);

    @RequestMapping(value="/data/merchchantConfirmTicketOrCancelOrder", method = RequestMethod.POST)
    Result merchchantConfirmTicketOrCancelOrder(@RequestParam("orderId") Long orderId,@RequestParam("status") int status);

    @RequestMapping(value = "/data/getDataProfitCount",method = RequestMethod.POST)
    Result getDataProfitCount(@RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime,@RequestParam("timeType") Integer timeType);

    @RequestMapping(value="/activity/saveSysActivity", method = RequestMethod.POST)
    Result saveSysActivity(@RequestBody AddSysActivityBO bo);

    @RequestMapping(value="/activity/deleteSysActivity", method = RequestMethod.POST)
    Result deleteSysActivity(@RequestParam("activityId") String activityId);

    @RequestMapping(value="/activity/querySysActivity", method = RequestMethod.POST)
    Result querySysActivity(@RequestBody Map<String, Object> paramMap);

    @RequestMapping(value="/activity/saveSysCoupon", method = RequestMethod.POST)
    Result saveSysCoupon(@RequestBody SysCouponBO bo);
    @RequestMapping(value="/activity/deleteSysCoupon", method = RequestMethod.POST)
    Result deleteSysCoupon(@RequestParam("couponId") String couponId);
    @RequestMapping(value="/activity/querySysCoupon", method = RequestMethod.POST)
    Result querySysCoupon(@RequestBody Map<String, Object> paramMap);

    @RequestMapping(value = "/data/getWinPrizeData",method = RequestMethod.POST)
    Result getWinPrizeData(@RequestBody Map<String, Object> paramMap);
    @RequestMapping(value = "/data/getAgentDataStatistics",method = RequestMethod.POST)
    Result getAgentDataStatistics(@RequestBody Map<String, Object> paramMap);
    @RequestMapping(value = "/sysConfig/getSysConfigList",method = RequestMethod.POST)
    Result getSysConfigList(@RequestBody Map<String, Object> paramMap);
    @RequestMapping(value="/sysConfig/update", method = RequestMethod.POST)
    Result updateSysConfig(@RequestBody SysConfigVO vo);

    /*------------------------------极光推送------------------------------**/
    @RequestMapping(value = "/jPushMsg/pushMsg",method = RequestMethod.POST)
    Result jPushMsgToUser(@RequestParam("target") String target, @RequestParam("title") String title,
                          @RequestParam("content") String content,@RequestParam("type") Integer type);

    @RequestMapping(value = "jPushMsg/getPushResult",method = RequestMethod.POST)
    Result getPushResult(@RequestParam("msgIds") String msgIds);


    @RequestMapping(value="/order//bonus/calc", method = RequestMethod.POST)
    Result orderBonusCalc(@RequestParam("lotteryId") Long lotteryId);

    @RequestMapping(value="/order//bonus/prize", method = RequestMethod.POST)
    Result orderBonusPrize(@RequestParam("lotteryId") Long lotteryId);
    @RequestMapping(value = "/userFunds/batchDrawCash", method = RequestMethod.POST)
    Result batchDrawCash();
    @RequestMapping(value = "/order/batchRefund", method = RequestMethod.POST)
    Result batchRefund();

    /*------------------------------代理商------------------------------**/
    @RequestMapping(value="/userInfo/agent/addUserAgent", method = RequestMethod.POST)
    Result addUserAgent(@RequestParam("mobile") String mobile,@RequestParam("agentId") String agentId);
    @RequestMapping(value="/userInfo/agent/deleteUserAgent", method = RequestMethod.POST)
    Result deleteUserAgent(@RequestParam("userId") Long userId,@RequestParam("status") Integer status);
    @RequestMapping(value = "/sysAgent/getUserAgentData",method = RequestMethod.POST)
    Result getUserAgentData(@RequestParam("startTime") String startTime,@RequestParam("endTime") String endTime,
                            @RequestParam("agentId") String agentId,@RequestParam("timeType") Integer timeType,
                            @RequestParam("pageNo") Integer pageNo,@RequestParam("pageSize") Integer pageSize);
    @RequestMapping(value = "/userInfo/sendCoupons",method = RequestMethod.POST)
    Result sendCoupons(@RequestParam("mobiles") String mobiles,@RequestParam("couponId") Long couponId);
    @RequestMapping(value = "/userInfo/closureOrRelease",method = RequestMethod.POST)
    Result closureOrRelease(@RequestParam("userId") Long userId,@RequestParam("enabled") Integer enabled);
    @RequestMapping(value="/userInfo/excelBatchExport", method = RequestMethod.POST)
    Result<List<UserInfoCMSVO>> excelBatchExportUser(@RequestBody UserInfoCMSBO bo);


    /*------------------------------商品------------------------------**/
    @RequestMapping(value="/product/save", method = RequestMethod.POST)
    Result saveProduct(@RequestBody ProductVO vo);
    @RequestMapping(value="/product/page", method = RequestMethod.POST)
    Result queryProductPage(@RequestBody ProductBO search);
    @RequestMapping(value="/product/excelBatchInsert", method = RequestMethod.POST)
    Result excelBatchInsert(@RequestParam("fileName") String fileName,@RequestBody Map<String, File> fileMap,@RequestParam("isUpdate") boolean isUpdate);
    @RequestMapping(value="/product/excelBatchInsert", method = RequestMethod.POST)
    Result excelBatchUpdate(@RequestParam("fileName") String fileName,@RequestBody Map<String, File> fileMap,@RequestParam("isUpdate") boolean isUpdate);
    @RequestMapping(value="/product/excelBatchExport", method = RequestMethod.POST)
    Result<List<ProductVO>> excelBatchExport(@RequestBody ProductSearchBO search);
    @RequestMapping(value = "/trade/page/list",method = RequestMethod.POST)
    Result getUserProductPage(@RequestBody Map<String,Object> paramMap);
    @RequestMapping(value = "/trade/detail",method = RequestMethod.POST)
    Result getUserProductDetail(@RequestParam("tradeId") String tradeId);
    @RequestMapping(value = "/trade/delivery",method = RequestMethod.POST)
    Result deliveryToUser(@RequestParam("tradeId") String tradeId,@RequestParam("logisticsNum") String logisticsNum,@RequestParam("logisticsCompany") String logisticsCompany);
    @RequestMapping(value = "/trade/edit",method = RequestMethod.POST)
    Result updateReceivingInfo(@RequestBody UserAddressVO userAddressVO);
    @RequestMapping(value = "/trade/list",method = RequestMethod.POST)
    Result<List<UserProductTradExcelVO>> getUserProductList(Map<String, Object> paramMap);
    @RequestMapping(value = "/trade/cancelUserProduct",method = RequestMethod.POST)
    Result cancelUserProduct(@RequestParam("id") String id);

    /********************************赛事管理**************************************/
    @RequestMapping(value = "/sys/match/leagueList",method = RequestMethod.POST)
    Result getAllLeague();
    @RequestMapping(value = "/sys/match/matchList",method = RequestMethod.POST)
    Result getMatchList(@RequestParam("leagueId") Long leagueId,@RequestParam("isHot") Integer isHot,@RequestParam("matchTime") String matchTime,@RequestParam("league") String league);
    @RequestMapping(value = "/sys/match/edit",method = RequestMethod.POST)
    Result editMatchList(@RequestParam("id") Long id,@RequestParam("isHot") Integer isHot);
    @RequestMapping(value = "/sys/match/matchResultList",method = RequestMethod.POST)
    Result getMatchResultList(@RequestParam("pageNo") Integer pageNo,@RequestParam("pageSize") Integer pageSize,@RequestParam("id") Long id,@RequestParam("leagueId") Long leagueId,@RequestParam("status") Integer status,@RequestParam("matchTime") String matchTime,@RequestParam("league") String league);
    @RequestMapping(value="/sys/match/saveMatchResult", method = RequestMethod.POST)
    Result saveMatchResult(@RequestBody JczqMatchLiveVO vo);
}
